/**
 * Copyright (c) 2013-Now http://jeesite.com All rights reserved.
 */
package com.jeesite.modules.goods.service;

import java.util.List;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.jeesite.common.entity.Page;
import com.jeesite.common.service.CrudService;
import com.jeesite.modules.goods.dao.ZtCommentDao;
import com.jeesite.modules.goods.entity.ZtComment;
import com.jeesite.modules.goods.entity.ZtGoods;

/**
 * 测试数据Service
 * 
 * @author ThinkGem
 * @version 2018-04-22
 */
@Service
@Transactional(readOnly = true)
public class ZtCommentService extends CrudService<ZtCommentDao, ZtComment> {
	
	/**
	 * 获取单条数据
	 * 
	 * @param testData
	 * @return
	 */
	@Override
	public ZtComment get(ZtComment ztComment) {
		ZtComment entity = super.get(ztComment);
		if (entity == null) {
			entity = new ZtComment();
		}
		return entity;
	}

	/**
	 * 查询分页数据
	 * 
	 * @param page
	 *            分页对象
	 * @param testData
	 * @return
	 */
	@Override
	public Page<ZtComment> findPage(Page<ZtComment> page, ZtComment ztComment) {
		return super.findPage(page, ztComment);
	}
	public int getCount(ZtComment ztComment) {
		return dao.getCount(ztComment);
	}
	
	
	/**
	 * 保存数据（插入或更新）
	 * 
	 * @param testData
	 */
	@Override
	@Transactional(readOnly = false)
	public void save(ZtComment ztComment) {
		super.save(ztComment);
	}

	/**
	 * 更新状态
	 * 
	 * @param testData
	 */
	@Override
	@Transactional(readOnly = false)
	public void updateStatus(ZtComment ztComment) {
		super.updateStatus(ztComment);
	}

	/**
	 * 删除数据
	 * 
	 * @param testData
	 */
	@Override
	@Transactional(readOnly = false)
	public void delete(ZtComment ztComment) {
		super.delete(ztComment);
	}
	public List<ZtComment> findMh(ZtComment ztComment){
		return dao.findMh(ztComment);
	}
	
	public List<ZtComment> findFirst(ZtComment ztComment){
		return dao.findFirst(ztComment);
	}
	
	
	public String avgStar(){
		return dao.avgStar();
	}
}